package org.example.project3.Mapper;

import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.project3.DTO.PageQueryDTO;
import org.example.project3.Entity.Article;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface ArticleMapper {
    List<Article> search(PageQueryDTO dto);
    void add(Article article);

    @Delete("delete from article where id = #{id}")
    void delete(Integer id);

    @Select("select * from article where id = #{id}")
    Article getByid(Integer id);

    void update(Article article);
}
